const btns = document.querySelectorAll('.favorite-icon');

let isRedHeart = false;
const toggleBtn = btn => {
  let heart = btn.innerHTML;
  heart= isRedHeart? '&#9825;': '&#10084;';
  btn.innerHTML = heart
  btn.classList.toggle('filled');
  isRedHeart = !isRedHeart;
}

btns.forEach(btn => {
  btn.addEventListener('click', () => toggleBtn(btn));
});